import Vue from 'vue'
import VueRouter from 'vue-router'
import Page from '../views/Page.vue';

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: 'page',
        component: Page,
        redirect: '/home',

        children: [
            {
                path: '/home',
                name: 'home',
                component: () => import('../views/Home.vue')
            },
            {
                path: '/detail',
                name: 'detail',
                component: () => import('../views/Detail.vue')
            },
            {
                path: '/add',
                name: 'add',
                component: () => import('../views/Add.vue')
            }
        ]
    },

]

const router = new VueRouter({
    mode: 'hash',
    routes
})

export default router
